
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录验证</title>
</head>
<body>
用户还没登录!<span id="sp" style="color: red">5</span>秒跳转到登录界面，如果没跳转请点击<a style="text-decoration: none" href="${pageContext.request.contextPath}/login.jsp"><span style="color: red">登录</span></a>
</body>
<script>
    var time=5;
    var datetime=setInterval(function () {
        var sp=document.getElementById("sp")
        if (time>=1){
            sp.innerHTML=time--;
        }else {
            clearInterval(datetime);
            location.href="${pageContext.request.contextPath}/login.jsp"
        }
    },1000)
</script>
</html>
